    project, err := getProject(d, config)
    if err != nil {
        return err
    }

    url, err := replaceVars(d, config, "{{ActiveDirectoryBasePath}}projects/{{project}}/locations/global/domains/{{domain}}:detachTrust")
    if err != nil {
        return err
    }

    <%#  The generate DELETE method isn't including the {trust: } object in the response body thus custom_delete is needed -%>

    obj := make(map[string]interface{})
    targetDomainNameProp, err := expandNestedActiveDirectoryDomainTrustTargetDomainName(d.Get("target_domain_name"), d, config)
    if err != nil {
        return err
    } else if v, ok := d.GetOkExists("target_domain_name"); !isEmptyValue(reflect.ValueOf(v)) && (ok || !reflect.DeepEqual(v, targetDomainNameProp)) {
        obj["targetDomainName"] = targetDomainNameProp
    }
    trustTypeProp, err := expandNestedActiveDirectoryDomainTrustTrustType(d.Get("trust_type"), d, config)
    if err != nil {
        return err
    } else if v, ok := d.GetOkExists("trust_type"); !isEmptyValue(reflect.ValueOf(v)) && (ok || !reflect.DeepEqual(v, trustTypeProp)) {
        obj["trustType"] = trustTypeProp
    }
    trustDirectionProp, err := expandNestedActiveDirectoryDomainTrustTrustDirection(d.Get("trust_direction"), d, config)
    if err != nil {
        return err
    } else if v, ok := d.GetOkExists("trust_direction"); !isEmptyValue(reflect.ValueOf(v)) && (ok || !reflect.DeepEqual(v, trustDirectionProp)) {
        obj["trustDirection"] = trustDirectionProp
    }
    selectiveAuthenticationProp, err := expandNestedActiveDirectoryDomainTrustSelectiveAuthentication(d.Get("selective_authentication"), d, config)
    if err != nil {
        return err
    } else if v, ok := d.GetOkExists("selective_authentication"); !isEmptyValue(reflect.ValueOf(v)) && (ok || !reflect.DeepEqual(v, selectiveAuthenticationProp)) {
        obj["selectiveAuthentication"] = selectiveAuthenticationProp
    }
    targetDnsIpAddressesProp, err := expandNestedActiveDirectoryDomainTrustTargetDnsIpAddresses(d.Get("target_dns_ip_addresses"), d, config)
    if err != nil {
        return err
    } else if v, ok := d.GetOkExists("target_dns_ip_addresses"); !isEmptyValue(reflect.ValueOf(v)) && (ok || !reflect.DeepEqual(v, targetDnsIpAddressesProp)) {
        obj["targetDnsIpAddresses"] = targetDnsIpAddressesProp
    }
    trustHandshakeSecretProp, err := expandNestedActiveDirectoryDomainTrustTrustHandshakeSecret(d.Get("trust_handshake_secret"), d, config)
    if err != nil {
        return err
    } else if v, ok := d.GetOkExists("trust_handshake_secret"); !isEmptyValue(reflect.ValueOf(v)) && (ok || !reflect.DeepEqual(v, trustHandshakeSecretProp)) {
        obj["trustHandshakeSecret"] = trustHandshakeSecretProp
    }

    obj, err = resourceActiveDirectoryDomainTrustEncoder(d, meta, obj)
    if err != nil {
        return err
    }

    log.Printf("[DEBUG] Deleting DomainTrust %q", d.Id())

    res, err := sendRequestWithTimeout(config, "POST", project, url, userAgent, obj, d.Timeout(schema.TimeoutDelete))
    if err != nil {
        return handleNotFoundError(err, d, "DomainTrust")
    }

    err = activeDirectoryOperationWaitTime(
        config, res, project, "Deleting DomainTrust", userAgent,
        d.Timeout(schema.TimeoutDelete))

    if err != nil {
        return err
    }

    log.Printf("[DEBUG] Finished deleting DomainTrust %q: %#v", d.Id(), res)
    return nil